package com.sx.gongzhong.pest;

import com.sx.gongzhong.model.PublicTotalBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.IPublicTotalView;

import java.util.List;

/**
 * Created by XZY on 2018/1/9.
 * 获取公共的字典列表
 */

public class PublicTotalPest {

    private IPublicTotalView publicView;

    public PublicTotalPest(IPublicTotalView publicView) {
        this.publicView = publicView;
    }

    public void getPublicTotal(){
        new ApiManager().getPublicBean(new BaseCallBack<ReplyUserBean.BaseResult<List<PublicTotalBean>>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<List<PublicTotalBean>> response) {
                publicView.getPublicTotal(response.getData());
            }

            @Override
            public void onFailures(String message) {
                publicView.showError(message);
            }
        });

    }
}
